#include "head.h"
/*  USEAGE: */
void md5(char *file_name, char *md5_num)
{ 
    char command[100];

    char *filename = file_name;
    sprintf(command, "md5sum %s", filename);

    FILE *fp = popen(command, "r");
    if (fp == NULL) {
        printf("无法执行命令\n");
        return;
    }

    //char output[100];
    //fgets(output, sizeof(output), fp);
    
    fgets(md5_num, sizeof(md5_num), fp);
    
    pclose(fp);

    printf("MD5 哈希值: %s\n", md5_num);

    //return;
}

